//
//  ConnectionManager.h
//  PCSchool
//
//  Created by Arindam Ghosh on 7/10/13.
//  Copyright (c) 2013 Jayanta. All rights reserved.
//

#import <Foundation/Foundation.h>

@class PCSchoolAppDelegate,ASIHTTPRequest;

@protocol ConnectionProtocol <NSObject>
@optional

-(id)postData; // A Dictionary with key-value pair
-(void)notifyRequesterWithData:(id) aData;

@end

@protocol ResponseHandler <NSObject>
-(void)notifyRequestFinished:(id) aManager;
@end

@interface ConnectionManager : NSObject
{
    id<ConnectionProtocol> requester; // to get post data from
    NSString* responseString;
	id webServiceResponce;
	NSString* requestName;	
	int request_id;
    
    ASIHTTPRequest* aRequest;
    id<ResponseHandler> handler;
    PCSchoolAppDelegate *appDelegate;


}

@property(nonatomic,assign) id<ConnectionProtocol> requester;
@property(nonatomic,copy)  NSString* responseString;
@property(nonatomic,retain) id webServiceResponce;
@property(nonatomic,retain)	NSString* requestName;
@property(nonatomic,assign) int request_id;
@property(nonatomic,retain)	ASIHTTPRequest* aRequest;
@property(nonatomic,assign) id<ResponseHandler> handler;
@property(nonatomic,assign) PCSchoolAppDelegate *appDelegate;


-(BOOL)sendRequest:(NSString*) strUrl andUserName:(NSString*) usr;
-(BOOL)startRequest;


@end
